MPDX-9811 Split NSO and IBS training costs into separate sections - #1949
Open
EJTison wants to merge 2 commits into
Open
MPDX-9811 Split NSO and IBS training costs into separate sections#1949EJTison wants to merge 2 commits into
EJTison wants to merge 2 commits into
Conversation
The Edit Training Costs modal captured NSO and IBS as one combined "NSO & IBS Cost" section, so a cohort could not be priced for an attendee who goes to NSO but not IBS. Splits the section into "NSO Cost" (unchanged four room/household types) and a new "IBS Cost" (Single, Couple), taking the modal from 11 to 13 fields. The keys now mirror NewStaffCohort::COST_FIELDS in mpdx_api one-for-one, so the modal can populate ibs_single_cost and ibs_couple_cost once the cohort API lands. Requested by Caleb Cox in Figma comment 127 on node 789-32532, after MPDX-9701 had already merged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Section order is what this change is actually about, so assert the headings as an ordered list rather than checking each is merely present. Verified the assertion fails when a heading is reordered or renamed. Also drops a stale "11 cost fields" count and rewords the TrainingCosts doc so it no longer implies the frontend keys are a mechanical suffix-stripping of the columns, and notes the columns are nullable while these fields are required. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Bundle sizes [mpdx-react]Compared against 0a0f7c3 No significant changes found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Edit Training Costs modal in the MPD Goal Calculator admin captured NSO and IBS as a single combined "NSO & IBS Cost" section. That made it impossible to price a cohort for someone who attends NSO but not IBS — and it left two backend columns with no way to be filled.
This splits that one section into two:
The modal goes from 11 to 13 fields, matching the design and the API.
Why this lands separately from MPDX-9701
The modal itself shipped in #1894 (MPDX-9701). On the same day it merged, Caleb left Figma comment #127 on the modal's design node:
The design was updated to match, but the modal wasn't. This is that follow-up.
Field naming
The keys now line up one-for-one with
NewStaffCohort::COST_FIELDSinmpdx_api(added in CruGlobal/mpdx_api#3425), soibs_single_costandibs_couple_costhave somewhere to come from once the cohort API exists:nso_individual_1_in_room_costnsoIndividual1InRoomnso_individual_2_in_room_costnsoIndividual2InRoomnso_couple_costnsoCouplenso_family_costnsoFamilyibs_single_costibsSingle✨ibs_couple_costibsCouple✨refresh_retreat_{single,couple}_costrefreshRetreat{Single,Couple}faith_and_finance_{single,couple}_costfaithAndFinance{Single,Couple}cru_conference_{single,couple,family}_costcruConference{Single,Couple,Family}Why the keys don't carry the columns'
_costsuffixEvery backend column ends in
_cost, but the pre-existing frontend keys never did (refreshRetreatSingle, notrefreshRetreatSingleCost). Keeping the file's existing convention means this diff touches the 4 NSO keys plus the 2 new IBS ones, instead of churning 7 untouched fields for no functional gain. These keys are mock-only today — codegen will supersede them when the cohort API lands.Testing
MpdGoalAdminis still a mock-data prototype with no GraphQL wiring, so there's nothing to persist yet — this is UI plus types.Automated: the modal's tests assert each input by its
(section, label)identity rather than positional index, soonSavereceiving the expected object genuinely proves every labelled input maps to its intended key — including the two new IBS ones.Out of scope
EditTrainingCostsModalstill uses a hand-rolled MUIDialograther than the sharedsrc/components/Shared/Modalthat its siblingAssignCoachModaluses. Worth aligning, but it would bury this change — leaving it for a follow-up.Checklist:
/pr-reviewcommand locally and fixed any relevant suggestionsRelated ticket: MPDX-9811
🤖 Generated with Claude Code